package com.yunhai.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yunhai.system.domain.TimeLine;
import com.yunhai.system.mapper.TimeLineMapper;
import com.yunhai.system.service.TimeLineService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 公司介绍--发展历程(TimeLine)表服务实现类
 *
 * @author jxj
 * @since 2021-01-09 19:17:19
 */
@Service("timeLineService")
public class TimeLineServiceImpl extends ServiceImpl<TimeLineMapper, TimeLine> implements TimeLineService {
    @Override
    public List<TimeLine> queryList(TimeLine timeLine) {
        LambdaQueryWrapper<TimeLine> lqw = Wrappers.lambdaQuery();
        if (StringUtils.isNotBlank(timeLine.getTitle())){
            lqw.eq(TimeLine::getTitle ,timeLine.getTitle());
        }
        lqw.orderByDesc(TimeLine::getCreateTime);
        return this.list(lqw);
    }
}